#!/usr/bin/env python
# -*- coding:utf-8 -*-

from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client

secret_id = 'AKIDFI6evvgANM5ZonUu3vXtynOincCWaNvC'  # 替换为用户的 secretId
secret_key = '3qMbe5GCrFNErELDtPgjY9WfbHjxxkKf'  # 替换为用户的 secretKey

region = 'ap-nanjing'  # 替换为用户的 Region

config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key)

client = CosS3Client(config)

# response = client.upload_file(
#     Bucket='django-bug-1311718222',
#     LocalFilePath='code.png',  # 本地文件的路径
#     Key='p1.png'  # 上传到桶之后的文件名
# )

response=client.create_bucket(
    Bucket='text-bug-1311718222',
    ACL="public-read"  # private  /  public-read / public-read-write
)
print(response)
